/**
 * 
 */
package v1c02;

import java.awt.BorderLayout;

import javax.swing.JApplet;
import javax.swing.JButton;
import javax.swing.JLabel;
import javax.swing.JPanel;
import javax.swing.SwingConstants;

/**
 * @author gjunming@gmail.com
 * @version 2009 Aug 4, 2:13:21 PM
 */
public class WelcomeApplet extends JApplet {

	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;
	private JPanel jContentPane = null;

	/**
	 * This is the xxx default constructor
	 */
	public WelcomeApplet() {
		super();
	}

	/**
	 * This method initializes this
	 * 
	 * @return void
	 */
	@Override
	public void init() {
		this.setSize(300, 200);
		this.setContentPane(getJContentPane());
	}

	/**
	 * This method initializes jContentPane
	 * 
	 * @return javax.swing.JPanel
	 */
	private JPanel getJContentPane() {
		if (jContentPane == null) {
			jContentPane = new JPanel();
			jContentPane.setLayout(new BorderLayout());
			JLabel title = new JLabel(getParameter("title"),
					SwingConstants.CENTER);
			JButton hello = new JButton("hello");
			JButton world = new JButton("world");
			jContentPane.add(title, BorderLayout.CENTER);
			jContentPane.add(hello, BorderLayout.NORTH);
			jContentPane.add(world, BorderLayout.CENTER);

		}
		return jContentPane;
	}

}
